Exemple #1
0
        private void fishDieHandler(SAFactoryEvent action)
        {
            FishData fs = (FishData)action.Body;

            if (sofVO.ContainsKey(fs.id))
            {
                sofVO.Remove(fs.id);
            }

            if (sofVO.Count == 0)//发送挂起
            {
                CHangUpRoom.Builder hangUpRoom = CHangUpRoom.CreateBuilder();
                sock.sendMessage(ProtoTypeEnum.CHangUpRoom, hangUpRoom.Build().ToByteArray());
            }
        }
Exemple #2
0
        public static System.Object getDataModel(ProtoTypeEnum type)
        {
            if (dataModel.ContainsKey(type))
            {
                return(dataModel[type]);
            }
            else
            {
                switch (type)
                {
                case ProtoTypeEnum.CLogin: {
                    return(CLogin.CreateBuilder());
                }

                case ProtoTypeEnum.SUserData: {
                    return(SUserData.CreateBuilder());
                }

                case ProtoTypeEnum.CEnterRoom: {
                    return(CEnterRoom.CreateBuilder());
                }

                case ProtoTypeEnum.COutRoom: {
                    return(COutRoom.CreateBuilder());
                }

                case ProtoTypeEnum.SOutRoom: {
                    return(SOutRoom.CreateBuilder());
                }

                case ProtoTypeEnum.SFishChapter: {
                    return(SFishChapter.CreateBuilder());
                }

                case ProtoTypeEnum.CHangUpRoom: {
                    return(CHangUpRoom.CreateBuilder());
                }

                case ProtoTypeEnum.SError: {
                    return(SError.CreateBuilder());
                }

                case ProtoTypeEnum.SSingleUpdate: {
                    return(SSingleUpdate.CreateBuilder());
                }

                case ProtoTypeEnum.CTest: {
                    return(CTest.CreateBuilder());
                }

                case ProtoTypeEnum.STest: {
                    return(STest.CreateBuilder());
                }

                case ProtoTypeEnum.CHeart: {
                    return(CHeart.CreateBuilder());
                }
                }
                return(null);
            }
        }