Ejemplo n.º 1
0
		public void OnPacket(GameServerPacket packet)
		{
			StocMessage id = packet.ReadStoc();
			if (id == StocMessage.GameMsg)
			{
				GameMessage msg = packet.ReadGameMsg();
				
				if (_messages.ContainsKey(msg)){
					_messages[msg](packet);
					#if DEBUG
					Logger.WriteLine("GameMessage deal "+msg);
					#endif
				}
				else{
					#if DEBUG
					Logger.WriteLine("GameMessage don't deal "+msg);
					#endif
				}
				return;
			}
			if (_packets.ContainsKey(id)){
				_packets[id](packet);
				#if DEBUG
				Logger.WriteLine("id deal "+id);
				#endif
			}else{
				#if DEBUG
				Logger.WriteLine("id don't deal "+id);
				#endif
			}
		}
Ejemplo n.º 2
0
 public void OnPacket(GameServerPacket packet)
 {
     StocMessage id = packet.ReadStoc();
     if (id == StocMessage.GameMsg)
     {
         GameMessage msg = packet.ReadGameMsg();
         if (_messages.ContainsKey(msg))
             _messages[msg](packet);
         return;
     }
     if (_packets.ContainsKey(id))
         _packets[id](packet);
 }