internal void SendWeatherSync(Session Player) { Packet p = new Packet() { _opcode = Packet.Opcode.SMSG_WEATHER_SYNC }; p.Push(_weatherManager.Current); Player.Write(p); }
internal void SendTimeSync(Session Player) { Packet p = new Packet() { _opcode = Packet.Opcode.SMSG_TIME_SYNC }; p.Push(_timeManager.Hour); p.Push(_timeManager.Day); p.Push(_timeManager.Month); Player.Write(p); }
public void Add(Session Player) { lock (_sessions) { _sessions.Enqueue(Player); } Player.SetWorld(this); Packet packet = new Packet() { _opcode = Packet.Opcode.SMSG_SHARD_HANDSHAKE }; packet.Push((uint)1); Player.Write(packet); SendTimeSync(Player); SendWeatherSync(Player); }
internal void HandlePlayerEvent(Session S) { }
public void Add(Session S) { }
void Remove(Session Player) { lock (_sessions) { // ♥ LINQ _sessions = new Queue<Session>( from s in _sessions where s._client.Client.RemoteEndPoint != Player._client.Client.RemoteEndPoint select s); } }
void DispatchToAllButMe(Packet Packet, Session Player) { }
void DispatchPlayerMoveAndLook(Session pPlayer) { lock (_sessions) { foreach (Session s in _sessions) if (s != pPlayer) s.HandlePlayerEvent(pPlayer); } }