コード例 #1
0
        public RoomClass GetRoomByRoomId(int id_val)
        {
            PhwangUtils.ListEntryClass list_entry = this.listMgr.GetEntryById(id_val);
            if (list_entry == null)
            {
                return(null);
            }
            RoomClass room_object = (RoomClass)list_entry.Data();

            return(room_object);
        }
コード例 #2
0
ファイル: UThemeParserClass.cs プロジェクト: paulhwang/asp_go
        private void processPutBaseDataResponse(string input_data_val)
        {
            this.debugIt(true, "processPutBaseDataResponse", input_data_val);
            string room_id_str = input_data_val.Substring(0, Protocols.ThemeEngineProtocolClass.THEME_ROOM_ID_SIZE);
            string data        = input_data_val.Substring(Protocols.ThemeEngineProtocolClass.THEME_ROOM_ID_SIZE);

            RoomClass room_object = this.RoomMgrObject().GetRoomByRoomIdStr(room_id_str);

            if (room_object == null)
            {
                this.abendIt("processPutBaseDataResponse", "null room");
                return;
            }

            string downlink_data = Protocols.FabricThemeProtocolClass.FABRIC_THEME_PROTOCOL_RESPOND_IS_PUT_ROOM_DATA;

            downlink_data = downlink_data + room_object.GroupIdStr() + data;
            this.DThemeObject().TransmitData(downlink_data);

            /*
             * char* downlink_data;
             * char* data_ptr;
             * int group_array_size;
             *
             *
             * RoomClass* room = this->theThemeObject->searchRoom(data_val);
             * if (!room)
             * {
             *  this->abend("processPutBaseDataResponse", "null room");
             *  return;
             * }
             * data_val += ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE;
             *
             * room->setGroupTableArray((char**)phwangArrayMgrGetArrayTable(room->groupArrayMgr(), &group_array_size));
             * for (int i = 0; i < group_array_size; i++)
             * {
             *  if (room->groupTableArray(i))
             *  {
             *      downlink_data = data_ptr = (char*)phwangMalloc(ROOM_MGR_DATA_BUFFER_SIZE + 4, "UTPB");
             * data_ptr++ = FABRIC_THEME_PROTOCOL_RESPOND_IS_PUT_ROOM_DATA;
             *      memcpy(data_ptr, room->groupTableArray(i), GROUP_MGR_PROTOCOL_GROUP_ID_INDEX_SIZE);
             *      data_ptr += GROUP_MGR_PROTOCOL_GROUP_ID_INDEX_SIZE;
             *      strcpy(data_ptr, data_val);
             *      this->theThemeObject->dThemeObject()->transmitFunction(downlink_data);
             *  }
             * }
             */
        }
コード例 #3
0
ファイル: UThemeParserClass.cs プロジェクト: paulhwang/asp_go
        private void processSetupBaseResponse(string input_data_val)
        {
            this.debugIt(true, "processSetupBaseResponse", input_data_val);

            string room_id_str = input_data_val.Substring(0, 4);
            string base_id_str = input_data_val.Substring(4);

            RoomClass room_object = this.RoomMgrObject().GetRoomByRoomIdStr(room_id_str);

            room_object.PutBaseIdStr(base_id_str);
            string downlink_data = Protocols.FabricThemeProtocolClass.FABRIC_THEME_PROTOCOL_RESPOND_IS_SETUP_ROOM;

            downlink_data = downlink_data + room_object.GroupIdStr() + room_object.RoomIdStr();
            this.DThemeObject().TransmitData(downlink_data);

            /*
             * char* room_id_index_val = data_val;
             *
             * char* downlink_data;
             * char* data_ptr;
             * int group_array_size;
             *
             * RoomClass* room = this->theThemeObject->searchRoom(room_id_index_val);
             * if (!room)
             * {
             *  this->abend("processSetupBaseResponse", "null room");
             *  return;
             * }
             *
             * data_val += ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE;
             * room->setBaseIdIndex(data_val);
             *
             * downlink_data = data_ptr = (char*)phwangMalloc(ROOM_MGR_DATA_BUFFER_SIZE + 4, "UTSB");
             * data_ptr++ = FABRIC_THEME_PROTOCOL_RESPOND_IS_SETUP_ROOM;
             *
             * room->setGroupTableArray((char**)phwangArrayMgrGetArrayTable(room->groupArrayMgr(), &group_array_size));
             * memcpy(data_ptr, room->groupTableArray(0), GROUP_MGR_PROTOCOL_GROUP_ID_INDEX_SIZE);
             * data_ptr += GROUP_MGR_PROTOCOL_GROUP_ID_INDEX_SIZE;
             *
             * memcpy(data_ptr, room->roomIdIndex(), ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE);
             * data_ptr += ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE;
             * data_ptr = 0;
             * this->theThemeObject->dThemeObject()->transmitFunction(downlink_data);
             */
        }
コード例 #4
0
ファイル: DThemeParserClass.cs プロジェクト: paulhwang/asp_go
        private void processPutRoomData(string input_data_val)
        {
            this.debugIt(true, "processPutRoomData", input_data_val);

            string    room_id_str = input_data_val.Substring(0, Protocols.ThemeEngineProtocolClass.THEME_ROOM_ID_SIZE);
            string    input_data  = input_data_val.Substring(Protocols.ThemeEngineProtocolClass.THEME_ROOM_ID_SIZE);
            RoomClass room        = this.RoomMgrObject().GetRoomByRoomIdStr(room_id_str);

            if (room == null)
            {
                this.abendIt("processPutRoomData", "null room");
                return;
            }

            string uplink_data = Protocols.ThemeEngineProtocolClass.THEME_ENGINE_PROTOCOL_COMMAND_IS_PUT_BASE_DATA;

            uplink_data = uplink_data + room.BaseIdStr() + input_data;
            this.UThemeObject().TransmitData(uplink_data);
        }
コード例 #5
0
ファイル: DThemeParserClass.cs プロジェクト: paulhwang/asp_go
        private void processSetupRoom(string input_data_val)
        {
            this.debugIt(true, "processSetupRoom", input_data_val);

            string group_id_index = input_data_val.Substring(0, Protocols.FabricThemeProtocolClass.FABRIC_GROUP_ID_SIZE);
            string input_data     = input_data_val.Substring(Protocols.FabricThemeProtocolClass.FABRIC_GROUP_ID_SIZE);

            RoomClass room = this.RoomMgrObject().MallocRoom(group_id_index);

            if (room == null)
            {
                string downlink_data;
                this.abendIt("processSetupRoom", "null room");
                //downlink_data = data_ptr = (char*)phwangMalloc(ROOM_MGR_DATA_BUFFER_SIZE + 4, "DTSr");
                //*data_ptr++ = FABRIC_THEME_PROTOCOL_RESPOND_IS_SETUP_ROOM;
                //strcpy(data_ptr, "null room");
                //this->transmitFunction(downlink_data);
                return;
            }

            /*
             * data_val += GROUP_MGR_PROTOCOL_GROUP_ID_INDEX_SIZE;
             *
             * uplink_data = data_ptr = (char*)phwangMalloc(ROOM_MGR_DATA_BUFFER_SIZE + 4, "DTSR");
             * data_ptr++ = THEME_ENGINE_PROTOCOL_COMMAND_IS_SETUP_BASE;
             *
             * memcpy(data_ptr, room->roomIdIndex(), ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE);
             * data_ptr += ROOM_MGR_PROTOCOL_ROOM_ID_INDEX_SIZE;
             *
             * strcpy(data_ptr, data_val);
             */
            string uplink_data = Protocols.ThemeEngineProtocolClass.THEME_ENGINE_PROTOCOL_COMMAND_IS_SETUP_BASE;

            uplink_data = uplink_data + room.RoomIdStr() + input_data;
            this.UThemeObject().TransmitData(uplink_data);
        }