smartfoxserver中配置文件config.xml的使用技巧
<SmartFoxConfig>
<ServerSetup>
<ServerIP>127.0.0.1</ServerIP>//服务器ip
<ServerPort>9339</ServerPort>//服务器端口
<AutoSendPolicyFile>true</AutoSendPolicyFile>//true表示允许sfs自动生成跨网域的政策文件
<MaxUserIdleTime>300</MaxUserIdleTime>//最大连接时间
<MaxRoomVars>-1</MaxRoomVars>//可以建立多少房间,-1表示无限
<MaxUserVars>-1</MaxUserVars>//最大数量的用户,1表示无限
<EnableNPC>true</EnableNPC>
<AntiFlood
active="false"> <!-- 只针对publicMeaage和PrivateMessage有效
-->
<MinMsgTime
tolerance="5">1000</MinMsgTime>//在最短时间内传递邮件数
<MaxRepeatedMessages>10</MaxRepeatedMessages>//客户端可以同时发送多少的邮件数
<WarningsBeforeKick>2</WarningsBeforeKick>//发出几条警告讯息后,用户将被踢
<WarningMessage><![CDATA[不合法操作!]]></WarningMessage>//自动警告讯息
<KickMessage><![CDATA[由于你的非法操作,将被踢出游戏]]></KickMessage>//自定的被踢讯息
<BanMessage><![CDATA[由于非法操作,你将被禁止进入游戏]]></BanMessage>//自定的禁止讯息
<BanAfter
timeSpan="1">3</BanAfter>//用户接到被踢讯息后,在制定的时间范围内,用户被踢
</AntiFlood>
<BadWordsFilter
active="true"><!-- 只有房间名和用户名可以过滤
-->
<FilterMode>REMOVE</FilterMode> <!-- REMOVE or FILTER
-->
<StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>
<Warnings>true</Warnings>
<FilterRoomNames>true</FilterRoomNames>
<FilterUserNames>true</FilterUserNames>
<WarningsBeforeKick>3</WarningsBeforeKick>
<WarningMessage><![CDATA[不能说脏话!)]]></WarningMessage>
<KickMessage><![CDATA[你现在因为说脏话被踢出游戏]]></KickMessage>
<BanMessage><![CDATA[你现在因为说脏话被禁止登录游戏!]]></BanMessage>
<BanAfter
timeSpan="1">3</BanAfter>
<BadWordsList>
<badWord>fuck
you</badWord>
<badWord>fuck</badWord>
</BadWordsList>
</BadWordsFilter>
<BanCleaning>auto</BanCleaning>
<BanDuration>1800</BanDuration>
<!-- 30 min
-->
<BannedLoginMessage>你已经被踢出游戏了!</BannedLoginMessage>
<OutQueueThreads>1</OutQueueThreads>
<ExtHandlerThreads>1</ExtHandlerThreads>
<MaxWriterQueue>50</MaxWriterQueue>
<ClientMessagQueue>
<QueueSize>80</QueueSize> <!--
每个用户允许的消息队列,适当的设置可以防止暴力攻击
-->
<MaxAllowedDroppedPackets>0</MaxAllowedDroppedPackets><!--
最多允许的丢失信息数量
-->
</ClientMessagQueue>
<MaxIncomingQueue>5000</MaxIncomingQueue>
<DeadChannelsPolicy>strict</DeadChannelsPolicy>
<DebugIncomingMessages>true</DebugIncomingMessages>
<DebugOutGoingMessages>true</DebugOutGoingMessages>
<MaxMsgLen>4096</MaxMsgLen>
<LogMaxSize>5000000</LogMaxSize>
<LogMaxFiles>5</LogMaxFiles>
<FileLoggingLevel>WARNING</FileLoggingLevel>
<ConsoleLoggingLevel>FINEST</ConsoleLoggingLevel>
<!--
管理员设置
-->
<AdminLogin>admin</AdminLogin>
<AdminPassword>passss</AdminPassword>
<AdminAllowedAddresses>
<AllowedAddress>*.*.*.*</AllowedAddress>
</AdminAllowedAddresses>
<ExtensionRemoteDebug>true</ExtensionRemoteDebug>
<AutoReloadExtensions>true</AutoReloadExtensions>
<IpFilter>0</IpFilter>
<!--一个IP最多允许多少用户同时登录
-->
<Mailer>
<MailHost>smtp.qq.com</MailHost>
<MailUser>cyh_cn@qq.com</MailUser>
<MailPass>wsfwl</MailPass>
<SmtpPort>25</SmtpPort>
<WorkerThreads>1</WorkerThreads>
</Mailer>
<EnableZoneInfo>true</EnableZoneInfo>
<WebServer
active="false">
<CfgFile>webserver/cfg/jetty.xml</CfgFile>
</WebServer>
<RawProtocolSeparator><![CDATA[%]]></RawProtocolSeparator>
</ServerSetup>
<Zones>
<!--
测试 -->
<Zone name="test" uCountUpdate="true" buddyList="20"
maxUsers="4000" customLogin="true" >
<Rooms>
<!--
limbo:可以容纳成千上万用户,性能高,但是功能比较少 -->
<!-- maxSpectators:最多旁观者
-->
<!-- isPrivate:需要password才能访问 -->
<!--
isGame:支持用户位置index和旁观者 -->
<Room name="The Hall" maxUsers="50"
isPrivate="false" isTemp="false" autoJoin="true" uCountUpdate="true"
/>
</Rooms>
<Extensions>
<extension name="ext"
className="it.gotoandplay.extensions.examples.SimpleExtension" type="java"
/>
<extension name="ext2"
className="it.gotoandplay.extensions.examples.SimpleExtension2" type="java"
/>
</Extensions>
<!-- 仲裁人员,可以踢除/屏蔽其他用户
-->
<Moderators status="off">
<Mod name="simon" pwd="simon"
/>
<Mod name="luke" pwd="luke"
/>
</Moderators>
<!-- 不允许的事件:onJoinRoom, onUserEnterRoom,
onRoomAdded, onRoomDeleted, onSpectatorSwitched, onUserCountChange,
onUserLeaveRoom, onRoomLeft, onRoomCreateError, onJoinRoomError,
onRoundTripResponse, onLogout
-->
<DisabledSysEvents>
<!--<event>onRoomDeleted</event>-->
</DisabledSysEvents>
<!--
不允许的指令:joinRoom, autoJoin, addBuddy, clearBuddyList, createRoom, getRoomList,
leaveRoom, loadBuddyList, removeBuddy, oundTripBench, sendObject,
sendObjectToGroup, sendPublicMessage, sendPrivateMessage, setRoomVariables,
setUserVariables, switchSpectator, getBuddyRoom
-->
<DisabledSysActions>
<!--<action>createRoom</action>
-->
</DisabledSysActions>
<!-- 最长允许用户名字长度
-->
<MaxUserNamesLen>20</MaxUserNamesLen>
<!--
最长允许房间名字长度
-->
<MaxRoomNamesLen>20</MaxRoomNamesLen>
</Zone>
</Zones>
</SmartFoxConfig>