37接口数据
parent
5c9168607d
commit
bb8ad768b5
|
|
@ -70,6 +70,10 @@ public class ServerProperties {
|
|||
this.num = num;
|
||||
}
|
||||
|
||||
public void setSendlog37(boolean sendlog37) {
|
||||
this.sendlog37 = sendlog37;
|
||||
}
|
||||
|
||||
public boolean isSendlog37() {
|
||||
return sendlog37;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,12 +11,10 @@ import com.ljsd.jieling.db.mongo.MongoKey;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.util.MathUtils;
|
||||
import com.ljsd.jieling.util.TimeUtils;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
|
||||
|
|
@ -82,6 +80,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int sendDays;
|
||||
|
||||
private Map<Integer,Long> onlineTimeOfDay = new HashMap<>(); // 20190808
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
|
@ -436,6 +436,7 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
public void addOnlineTime(long onlineTime) {
|
||||
this.onlineTime += onlineTime;
|
||||
setOnlineTimeOfDay(onlineTime);
|
||||
updateString("onlineTime", this.onlineTime);
|
||||
}
|
||||
|
||||
|
|
@ -456,4 +457,14 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("sendDays", sendDays);
|
||||
this.sendDays = sendDays;
|
||||
}
|
||||
|
||||
private void setOnlineTimeOfDay(long time) {
|
||||
int day= Integer.valueOf(TimeUtils.getTimeStampYMD(System.currentTimeMillis()));
|
||||
this.onlineTimeOfDay.put(day,this.onlineTimeOfDay.getOrDefault(day,0L)+time);
|
||||
updateString("onlineTimeOfDay", this.onlineTimeOfDay);
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getOnlineTimeOfDay() {
|
||||
return onlineTimeOfDay;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue