Skip to content

Commit

Permalink
Various tweeks and fixes, mostly gmcp related
Browse files Browse the repository at this point in the history
git-svn-id: svn://192.168.1.10/public/CoffeeMud@23502 0d6f1817-ed0e-0410-87c9-987e46238f29
  • Loading branch information
bozimmerman committed Nov 11, 2024
1 parent ec0ae8c commit 53cd83f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion com/planet_ink/coffee_mud/Commands/Switch.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ public boolean execute(final MOB mob, final List<String> commands, final int met
sess.stopSession(true, true, true);
else
{
sess.setStat("CPING", "true");
CMLib.login().showTheNews(target);

Log.sysOut(mob.Name()+" switched login to: "+target.Name());
}
}
Expand Down
11 changes: 9 additions & 2 deletions com/planet_ink/coffee_mud/Common/DefaultSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -3657,7 +3657,7 @@ public void setIdleTimers()
private static enum SESS_STAT_CODES {PREVCMD,ISAFK,AFKMESSAGE,ADDRESS,IDLETIME,
LASTMSG,LASTNPCFIGHT,LASTPKFIGHT,TERMTYPE,
TOTALMILLIS,TOTALTICKS,WRAP,LASTLOOPTIME,
ROOMLOOK,TWRAP,PPING}
ROOMLOOK,TWRAP,PPING,CPING}

@Override
public int getSaveStatIndex()
Expand Down Expand Up @@ -3719,8 +3719,8 @@ public String getStat(final String code)
case LASTLOOPTIME:
return CMLib.time().date2String(getInputLoopTime());
case ROOMLOOK:
break; // do nothing
case PPING:
case CPING:
break; // do nothing
case TWRAP:
return ""+this.terminalWidth;
Expand Down Expand Up @@ -3783,6 +3783,13 @@ public void setStat(final String code, final String val)
case LASTLOOPTIME:
lastLoopTop = CMLib.time().string2Millis(val);
break;
case CPING:
if(getClientTelnetMode(TELNET_GMCP))
{
this.gmcpPings.clear();
this.doProtocolPings();
}
break;
case PPING:
this.gmcpPings.remove("system.nextMedReport");
this.doProtocolPings();
Expand Down
5 changes: 4 additions & 1 deletion com/planet_ink/coffee_mud/Common/DefaultTriggerer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,10 @@ protected TrigState stepGetCompleted(final MOB hostM, final Object key, final CM
case DRINK:
case EAT:
if((msg.target()!=null)
&&(DT.parm1.equals("0")||containsString(msg.target().name(),DT.parm1)))
&&(DT.parm1.equals("0")
||containsString(msg.target().name(),DT.parm1)
||((msg.target() instanceof Item)
&&(containsString(RawMaterial.CODES.NAME(((Item)msg.target()).material()),DT.parm1)))))
{
if(state == null)
state = getCreateTrigState(hostM, key);
Expand Down
4 changes: 2 additions & 2 deletions com/planet_ink/coffee_mud/Libraries/CMProtocols.java
Original file line number Diff line number Diff line change
Expand Up @@ -2765,7 +2765,7 @@ protected String processGmcpStr(final Session session, final String jsonData,
doc.append("\"group\":\""+MiniJSON.toJSONString(groupName)+"\",");
doc.append("\"list\":[");
for(final Ability A : allMyGroups.get(grp))
doc.append("\"").append(MiniJSON.toJSONString(A.name().toLowerCase())).append("\",");
doc.append("\"").append(MiniJSON.toJSONString(A.name())).append("\",");
doc.setCharAt(doc.length()-1,']');
break;
}
Expand Down Expand Up @@ -2794,7 +2794,7 @@ protected String processGmcpStr(final Session session, final String jsonData,
if((A!=null)&&(A.name().toLowerCase().equals(name)))
{
doc.append("\"group\":\""+MiniJSON.toJSONString(getAbilityGroupName(A.abilityCode()))+"\",");
doc.append("\"skill\":\""+MiniJSON.toJSONString(name)+"\",");
doc.append("\"skill\":\""+MiniJSON.toJSONString(A.name())+"\",");
doc.append("\"info\":\""+MiniJSON.toJSONString(CMLib.help().getHelpText(A.Name().toUpperCase(), mob, false).toString())+"\"");
break;
}
Expand Down
6 changes: 6 additions & 0 deletions com/planet_ink/coffee_mud/Libraries/CoffeeShops.java
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,12 @@ public boolean ignoreIfNecessary(final MOB mob, final String ignoreMask, final M
mob.tell(whoIgnores,null,null,L("<S-NAME> appear(s) to be ignoring you."));
return false;
}
if((whoIgnores != null)
&&(whoIgnores.amDead() || whoIgnores.isInCombat()))
{
mob.tell(whoIgnores,null,null,L("<S-NAME> appear(s) to be too busy right now."));
return false;
}
return true;
}

Expand Down

0 comments on commit 53cd83f

Please sign in to comment.