public void SendCharacterUpdatedGameEvent() { SessionData sessionData= SessionData.GetInstance(); GameData gameData= sessionData.CurrentGameData; GameEvent_CharacterUpdated gameEvent = new GameEvent_CharacterUpdated(); gameEvent.CharacterID = gameData.CharacterID; SendGameEvent(gameEvent); }
public void SendCharacterUpdatedGameEvent() { SessionData sessionData = SessionData.GetInstance(); GameData gameData = sessionData.CurrentGameData; GameEvent_CharacterUpdated gameEvent = new GameEvent_CharacterUpdated(); gameEvent.CharacterID = gameData.CharacterID; SendGameEvent(gameEvent); }
// Game Specific Events private void PostThisPlayerJoinedGameChannel() { int currentCharacterID = SessionData.GetInstance().CharacterID; GameEvent_CharacterUpdated characterUpdateEvent = new GameEvent_CharacterUpdated(); // Add ourselves to the username -> character id mapping table AddIrcNickToCharacterIdMap(m_ircNick, currentCharacterID); // Send the event characterUpdateEvent.CharacterID = currentCharacterID; SendGameEvent(characterUpdateEvent); }
private void GameEventHandler(string fromNick, GameEvent gameEvent) { // Use the CharacterUpdated events to keep track of nick -> character ID mappings if (gameEvent is GameEvent_CharacterUpdated) { GameEvent_CharacterUpdated characterUpdatedEvent = gameEvent as GameEvent_CharacterUpdated; if (GetCharacterIdForIrcNick(fromNick) == -1) { AddIrcNickToCharacterIdMap(fromNick, characterUpdatedEvent.CharacterID); } } OutputGameEvent(gameEvent); }
private void PostOtherPlayerLeftGameChannel(string nick) { int characterId = GetCharacterIdForIrcNick(nick); if (characterId != -1) { // Locally force the character to update GameEvent_CharacterUpdated characterUpdatedEvent = new GameEvent_CharacterUpdated(); characterUpdatedEvent.CharacterID = characterId; OutputGameEvent(characterUpdatedEvent); // Remove the kicked individual from the nick -> character id mapping RemoveIrcNickFromCharacterIdMap(nick); } }
// Game Specific Events private void PostThisPlayerJoinedGameChannel() { int currentCharacterID = SessionData.GetInstance().CharacterID; GameEvent_CharacterUpdated characterUpdateEvent = new GameEvent_CharacterUpdated(); // Add ourselves to the username -> character id mapping table AddIrcNickToCharacterIdMap(m_ircNick, currentCharacterID); // Send the event characterUpdateEvent.CharacterID = currentCharacterID; SendGameEvent(characterUpdateEvent); }
private void PostOtherPlayerLeftGameChannel(string nick) { int characterId = GetCharacterIdForIrcNick(nick); if (characterId != -1) { // Locally force the character to update GameEvent_CharacterUpdated characterUpdatedEvent = new GameEvent_CharacterUpdated(); characterUpdatedEvent.CharacterID = characterId; OutputGameEvent(characterUpdatedEvent); // Remove the kicked individual from the nick -> character id mapping RemoveIrcNickFromCharacterIdMap(nick); } }