Ejemplo n.º 1
0
        void HandleJoinReq(Session session, WorldJoinPacket p)
        {
            var ok = Join(session, p.Nickname, p.Mode);

            log.Info($"world join: id={session.ID} world={ID} ok={ok} size={sessions.Count}");

            var holder = GetPlayerHolder(session);

            if (holder.Mode == PlayerMode.Player)
            {
                room.Join(holder.Player);
            }
            else if (holder.Mode == PlayerMode.Observer)
            {
                room.Join(holder.Observer);
            }
            else
            {
                return;
            }

            var resp = new WorldJoinResultPacket(0, session.ID);

            session.SendLazy(resp);
        }
Ejemplo n.º 2
0
        public void TestSerde()
        {
            var a = new WorldJoinResultPacket(0, 123);
            var b = SerializeAndDeserialize(a);

            Assert.Equal(a, b);
        }
Ejemplo n.º 3
0
 void HandleWorldJoin(WorldJoinResultPacket p)
 {
     Debug.Assert(0 == p.ResultCode);
 }