#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
#-------------------------------------------------------------------------------
|
#
|
##@package GM.Commands.test_OnMonth
|
#
|
# @todo:test_OnMonth
|
# @author ljd
|
# @date 2015-06-17 12:00
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: test_OnMonth
|
#
|
#---------------------------------------------------------------------
|
#"""Version = 2015-06-17 12:00"""
|
#---------------------------------------------------------------------
|
import GameWorldProcess
|
import ShareDefine
|
import GameWorld
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ ÕâÀïcurPlayer
|
## Ö´ÐÐÂß¼ Ö´Ðиø¶¨²ÎÊý´ÎonMonth
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param playerList ÃüÁîÖ´ÐеĴÎÊý СÓÚ=ÓÚ3
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷. ÊÀ½ç·þÎñÆ÷Ö´ÐÐOnMonth
|
def OnExec(curPlayer, playerList):
|
timeStr = GameWorld.GetCurrentDataTimeStr()
|
tick = GameWorld.GetGameWorld().GetTick()
|
|
if len(playerList) == 0:
|
DoLogic_GM_OnMonth(timeStr, tick)
|
return
|
|
count = playerList[0]
|
|
if count > 3:
|
return
|
|
for i in range(count):
|
DoLogic_GM_OnMonth(timeStr, tick)
|
|
return
|
|
## È«¾Öº¯Êý¼òҪ˵Ã÷£ºÊÀ½ç·þÎñÆ÷Ö´ÐÐ test_OnMonth Ò»´Î ²¢Í¨ÖªÔÚÏßËùÓÐÍæ¼Ò
|
# @param timeStr ʱ¼ä´Á
|
# @param tick µ±Ç°tick
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks º¯ÊýÏêϸ˵Ã÷£ºÊÀ½ç·þÎñÆ÷Ö´ÐÐ test_OnMonth Ò»´Î ÐèҪͬʱµôÓÃOnWeek OnDay OnHour
|
def DoLogic_GM_OnMonth(timeStr, tick):
|
playerManager = GameWorld.GetPlayerManager()
|
|
for i in range(0, playerManager.GetPlayerCount()):
|
curPlayer = playerManager.GetPlayerByIndex(i)
|
|
if not curPlayer or curPlayer.IsEmpty():
|
continue
|
|
mapID = GameWorld.GetQueryPlayerMapID(curPlayer)
|
|
if not mapID:
|
continue
|
|
playerManager.MapServer_QueryPlayer(0, 0, curPlayer.GetID(), mapID, 'GMDateTime', 'GMOnMonth', len("GMOnMonth"))
|
|
GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnDayEx, 0)
|
GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnWeekEx, 0)
|
GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OnMonthEx, 0)
|
|
GameWorldProcess.OnHour(timeStr, tick)
|
GameWorldProcess.OnDay(timeStr, tick)
|
GameWorldProcess.OnDayEx(tick)
|
GameWorldProcess.OnWeek(timeStr, tick)
|
GameWorldProcess.OnWeekEx(tick)
|
GameWorldProcess.OnMonth(timeStr, tick)
|
GameWorldProcess.OnMonthEx(tick)
|
return
|