OSDN Git Service

一部ルームで退出したにもかかわらず名前が表示されるバグを修正した
[webchat/WebChat.git] / chatServer.js
index ae3847e..78dad96 100644 (file)
@@ -658,13 +658,17 @@ function RoomInfomationCollection()
        function Clear(){\r
                collection = {};\r
                for(var i = 0; i < $max_room_number; i++)\r
-                       Add(i,null,false);\r
+                       Add(i,null,null);\r
        };\r
        function Add(rno,pass,hiddenlogflag){\r
                collection[rno] = new RoomInfomation(pass,hiddenlogflag);\r
                if(pass != null)\r
                        collection[rno].owner = $system_name;\r
        };\r
+       var $gc_interval_id = setInterval(function(){\r
+               for(var rno in this.rom_list)\r
+                       collection[rno].GCRomList();\r
+       },$gc_time_interval);\r
        GetRoomList();\r
 }\r
 \r
@@ -680,7 +684,8 @@ function RoomInfomation(pass,hiddenlogflag)
        this.IsVolatile = function(){\r
                return this.owner == null &&\r
                        this.password == null &&\r
-                       this.time == null;\r
+                       this.time == null &&\r
+                       this.hiddenlog == null;\r
        }\r
        this.GetRomCount = function(){\r
                var count = 0;\r
@@ -750,7 +755,7 @@ function RoomInfomation(pass,hiddenlogflag)
                }\r
                return false;\r
        };\r
-       var $gc_interval_id = setInterval(function(){\r
+       this.GCRomList = function(){\r
                var date = new Date();\r
                var current_time = date.getTime();\r
                for(var ip in this.rom_list)\r
@@ -758,7 +763,7 @@ function RoomInfomation(pass,hiddenlogflag)
                        if(current_time - this.rom_list[ip].time >= $gc_time_interval)\r
                                delete this.rom_list[ip];\r
                }\r
-       },$gc_time_interval);\r
+       };\r
 }\r
 \r
 //IPBANクラス\r