예제 #1
0
BOOL NetworkPrefs2Gadgets
(
    struct NetPEditor_DATA *data
)
{
    NNSET(data->netped_deviceString, MUIA_String_Contents, (IPTR)GetDevice());
    NNSET(data->netped_IPString, MUIA_String_Contents, (IPTR)GetIP());
    NNSET(data->netped_maskString, MUIA_String_Contents, (IPTR)GetMask());
    NNSET(data->netped_gateString, MUIA_String_Contents, (IPTR)GetGate());
    NNSET(data->netped_DNSString[0], MUIA_String_Contents, (IPTR)GetDNS(0));
    NNSET(data->netped_DNSString[1], MUIA_String_Contents, (IPTR)GetDNS(1));
    NNSET(data->netped_hostString, MUIA_String_Contents, (IPTR)GetHost());
    NNSET(data->netped_domainString, MUIA_String_Contents, (IPTR)GetDomain());
    NNSET(data->netped_DHCPState, MUIA_Cycle_Active, (IPTR)GetDHCP());
    NNSET(data->netped_Autostart, MUIA_Selected, (IPTR)GetAutostart());

    return TRUE;
}
예제 #2
0
void BattlegroundSA::ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject* invoker /*= NULL*/)
{
    if (GameObject* go = obj->ToGameObject())
    {
        switch (go->GetGoType())
        {
            case GAMEOBJECT_TYPE_GOOBER:
                if (invoker)
                    if (eventId == BG_SA_EVENT_TITAN_RELIC_ACTIVATED)
                        TitanRelicActivated(invoker->ToPlayer());
                break;
            case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
            {
                if (GateInfo const* gate = GetGate(obj->GetEntry()))
                {
                    uint8 gateId = gate->GateId;

                    // damaged
                    if (eventId == go->GetGOInfo()->building.damagedEvent)
                    {
                        GateStatus[gateId] = BG_SA_GATE_DAMAGED;

                        if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
                            SendChatMessage(c, gate->DamagedText, invoker);

                        PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_ATTACKED_ALLIANCE : SOUND_WALL_ATTACKED_HORDE);
                    }
                    // destroyed
                    else if (eventId == go->GetGOInfo()->building.destroyedEvent)
                    {
                        GateStatus[gate->GateId] = BG_SA_GATE_DESTROYED;
                        _gateDestroyed = true;

                        if (gateId < 5)
                            DelObject(gateId + 14);

                        if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
                            SendChatMessage(c, gate->DestroyedText, invoker);

                        PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_DESTROYED_ALLIANCE : SOUND_WALL_DESTROYED_HORDE);

                        bool rewardHonor = true;
                        switch (gateId)
                        {
                            case BG_SA_GREEN_GATE:
                                if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
                                    rewardHonor = false;
                                break;
                            case BG_SA_BLUE_GATE:
                                if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED)
                                    rewardHonor = false;
                                break;
                            case BG_SA_RED_GATE:
                                if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)
                                    rewardHonor = false;
                                break;
                            case BG_SA_PURPLE_GATE:
                                if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED)
                                    rewardHonor = false;
                                break;
                            default:
                                break;
                        }

                        if (invoker)
                        {
                            if (Unit* unit = invoker->ToUnit())
                            {
                                if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself())
                                {
                                    UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1);
                                    if (rewardHonor)
                                        UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1));
                                }
                            }
                        }
                    }
                    else
                        break;

                    UpdateWorldState(gate->WorldState, GateStatus[gateId]);
                }
                break;
            }
            default:
                break;
        }
    }
}