OSDN Git Service
(root)
/
webchat
/
WebChat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c40b3b
)
管理画面表示時に落ちるバグ&部屋情報が正しく表示されないバグを修正した
author
gdkhd812
<jbh03215@hotmail.co.jp>
Fri, 30 May 2014 17:52:37 +0000
(
02:52
+0900)
committer
gdkhd812
<jbh03215@hotmail.co.jp>
Fri, 30 May 2014 17:52:37 +0000
(
02:52
+0900)
room.js
patch
|
blob
|
history
diff --git
a/room.js
b/room.js
index
b64a059
..
a5ff81c
100644
(file)
--- a/
room.js
+++ b/
room.js
@@
-1,6
+1,7
@@
//RoomInfomationCollecion
\83
N
\83
\89
\83
X
module.exports = function()
{
//RoomInfomationCollecion
\83
N
\83
\89
\83
X
module.exports = function()
{
+ var _this = this;
var config = require("./configure.js");
var MySQLPool = new require("./mysql_pool.js");
var pool = new MySQLPool({
var config = require("./configure.js");
var MySQLPool = new require("./mysql_pool.js");
var pool = new MySQLPool({
@@
-22,7
+23,7
@@
module.exports = function()
for(var rno in collection)
{
item={};
for(var rno in collection)
{
item={};
- item.applyflag = !
$room
s.Get(rno).IsVolatile();
+ item.applyflag = !
_thi
s.Get(rno).IsVolatile();
item.password = collection[rno].password;
if(item.password == null)
item.password = "";
item.password = collection[rno].password;
if(item.password == null)
item.password = "";
@@
-104,7
+105,7
@@
module.exports = function()
collection[rno].owner = $system_name;
};
var $gc_interval_id = setInterval(function(){
collection[rno].owner = $system_name;
};
var $gc_interval_id = setInterval(function(){
- for(var rno in this.rom_list)
+ for(var rno in
_
this.rom_list)
collection[rno].GCRomList();
},$gc_time_interval);
GetRoomList();
collection[rno].GCRomList();
},$gc_time_interval);
GetRoomList();
@@
-113,6
+114,7
@@
module.exports = function()
//RoomInfomation
\83
N
\83
\89
\83
X
function RoomInfomation(pass,hiddenlogflag)
{
//RoomInfomation
\83
N
\83
\89
\83
X
function RoomInfomation(pass,hiddenlogflag)
{
+ var _this = this;
this.password = pass;
this.rom_list = {};
this.authed_list = {};
this.password = pass;
this.rom_list = {};
this.authed_list = {};
@@
-121,90
+123,90
@@
function RoomInfomation(pass,hiddenlogflag)
this.hiddenlog = hiddenlogflag;
this.GetConfig = function(){
var roomconfig = {};
this.hiddenlog = hiddenlogflag;
this.GetConfig = function(){
var roomconfig = {};
- if(this.IsVolatile() == false)
+ if(
_
this.IsVolatile() == false)
{
{
- if(this.IsFixedPassword())
+ if(
_
this.IsFixedPassword())
roomconfig.type = 2;
roomconfig.type = 2;
- else if(this.IsHiddenLogFromRom())
+ else if(
_
this.IsHiddenLogFromRom())
roomconfig.type = 3;
else
roomconfig.type = 1;
roomconfig.type = 3;
else
roomconfig.type = 1;
- roomconfig.IsOwned = !this.IsFirstAuth();
+ roomconfig.IsOwned = !
_
this.IsFirstAuth();
}else{
roomconfig.type = 0;
}
return roomconfig;
}
this.IsVolatile = function(){
}else{
roomconfig.type = 0;
}
return roomconfig;
}
this.IsVolatile = function(){
- return this.owner == null &&
- this.password == null &&
- this.time == null &&
- this.hiddenlog == null;
+ return
_
this.owner == null &&
+
_
this.password == null &&
+
_
this.time == null &&
+
_
this.hiddenlog == null;
}
this.GetRomCount = function(){
var count = 0;
}
this.GetRomCount = function(){
var count = 0;
- for(var key in this.rom_list)
+ for(var key in
_
this.rom_list)
count++;
return count;
};
this.AddRom = function(ip){
var date = new Date();
count++;
return count;
};
this.AddRom = function(ip){
var date = new Date();
- this.rom_list[ip] = {time:date.getTime()};
+
_
this.rom_list[ip] = {time:date.getTime()};
};
this.RemoveRom = function(ip){
};
this.RemoveRom = function(ip){
- delete this.rom_list[ip];
+ delete
_
this.rom_list[ip];
};
this.Reset = function(owner){
var date = new Date();
var time = date.getTime();
};
this.Reset = function(owner){
var date = new Date();
var time = date.getTime();
- this.password = null;
- this.authed_list = {};
- this.owner = owner;
- this.time = time;
+
_
this.password = null;
+
_
this.authed_list = {};
+
_
this.owner = owner;
+
_
this.time = time;
};
this.IsFirstAuth = function(){
};
this.IsFirstAuth = function(){
- return this.owner == null;
+ return
_
this.owner == null;
};
this.IsAuthed = function(name){
};
this.IsAuthed = function(name){
- return name == this.owner ||
- name in this.authed_list;
+ return name ==
_
this.owner ||
+ name in
_
this.authed_list;
};
this.IsHiddenLogFromRom = function(){
};
this.IsHiddenLogFromRom = function(){
- return this.hiddenlog;
+ return
_
this.hiddenlog;
};
this.IsFixedPassword = function(){
};
this.IsFixedPassword = function(){
- return this.owner == $system_name;
+ return
_
this.owner == $system_name;
};
this.IsOwner = function(name){
};
this.IsOwner = function(name){
- return this.owner == name;
+ return
_
this.owner == name;
};
this.IsTimeout = function(){
var date = new Date();
var current_time = date.getTime();
};
this.IsTimeout = function(){
var date = new Date();
var current_time = date.getTime();
- return !this.IsFixedPassword() &&
- current_time - this.time >= $reset_password_diff;
+ return !
_
this.IsFixedPassword() &&
+ current_time -
_
this.time >= $reset_password_diff;
};
this.RemoveAuth = function(name)
{
};
this.RemoveAuth = function(name)
{
- delete this.authed_list[name];
+ delete
_
this.authed_list[name];
};
this.Auth = function(name,password){
};
this.Auth = function(name,password){
- if(this.password != password)
+ if(
_
this.password != password)
return false;
var date = new Date();
var time = date.getTime();
return false;
var date = new Date();
var time = date.getTime();
- this.time = time;
- this.authed_list[name] = "";
+
_
this.time = time;
+
_
this.authed_list[name] = "";
return true;
};
this.SetPassword = function(owner,password){
return true;
};
this.SetPassword = function(owner,password){
- if(owner == this.owner &&
- !this.IsFixedPassword() &&
- !this.IsHiddenLogFromRom())
+ if(owner ==
_
this.owner &&
+ !
_
this.IsFixedPassword() &&
+ !
_
this.IsHiddenLogFromRom())
{
var date = new Date();
{
var date = new Date();
- this.time = date.getTime();
- this.password = password;
+
_
this.time = date.getTime();
+
_
this.password = password;
return true;
}
return false;
return true;
}
return false;
@@
-212,10
+214,10
@@
function RoomInfomation(pass,hiddenlogflag)
this.GCRomList = function(){
var date = new Date();
var current_time = date.getTime();
this.GCRomList = function(){
var date = new Date();
var current_time = date.getTime();
- for(var ip in this.rom_list)
+ for(var ip in
_
this.rom_list)
{
{
- if(current_time - this.rom_list[ip].time >= $gc_time_interval)
- delete this.rom_list[ip];
+ if(current_time -
_
this.rom_list[ip].time >= $gc_time_interval)
+ delete
_
this.rom_list[ip];
}
};
}
}
};
}