- const increment = tcParts[1].match(/([0-9]+)([smhd])/);
- if (!increment)
- return "Wrong time control";
- const incrementValue = parseInt(increment[1]);
- const incrementUnit = increment[2];
- if (isLargerUnit(incrementUnit, mainTimeUnit))
- return "Increment unit cannot be larger than main unit";
- if (isNaN(incrementValue) || incrementValue < 0)
- return "Increment must be positive";
- c.increment = timeUnitToSeconds(incrementValue, incrementUnit);
+ // NOTE: slightly redundant (see data/userCheck.js)
+ if (!c.to.match(/^[\w]+$/))
+ return "Wrong characters in opponent name";