"We'll add it when we need it" was what was said before, and now the
default non-fucking-obtuse dictionary has been replaced by a scrabble dictionary that contains fucked-up wordfreak words. You know, if you're playing a normal game "abys" is wrong, and "abyss" is right. So I at least added the parameter for selecting a dictionary. Implementation pending. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@492 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -78,11 +78,12 @@ public interface EZGameService extends InvocationService
|
||||
* @param client stores information about the caller
|
||||
* @param locale is an RFC 3066 string specifying language settings, for example, "en" or
|
||||
* "en-us".
|
||||
* @param dictionary is a String specifier of the dictionary to use, or null for the default.
|
||||
* @param count is the number of letters to be returned.
|
||||
* @param listener is the callback function
|
||||
*/
|
||||
public void getDictionaryLetterSet (
|
||||
Client client, String locale, int count, ResultListener listener);
|
||||
Client client, String locale, String dictionary, int count, ResultListener listener);
|
||||
|
||||
/**
|
||||
* Ask the dictionary service whether the specified word is valid with the given
|
||||
@@ -91,11 +92,12 @@ public interface EZGameService extends InvocationService
|
||||
* @param client stores information about the caller
|
||||
* @param locale is an RFC 3066 string specifying language settings, for example, "en" or
|
||||
* "en-us".
|
||||
* @param dictionary is a String specifier of the dictionary to use, or null for the default.
|
||||
* @param word is the word to be checked against the dictionary.
|
||||
* @param listener is the callback function
|
||||
*/
|
||||
public void checkDictionaryWord (
|
||||
Client client, String locale, String word, ResultListener listener);
|
||||
Client client, String locale, String dictionary, String word, ResultListener listener);
|
||||
|
||||
/**
|
||||
* Add to the specified named collection.
|
||||
|
||||
@@ -54,12 +54,12 @@ public class EZGameMarshaller extends InvocationMarshaller
|
||||
public static final int CHECK_DICTIONARY_WORD = 2;
|
||||
|
||||
// from interface EZGameService
|
||||
public void checkDictionaryWord (Client arg1, String arg2, String arg3, InvocationService.ResultListener arg4)
|
||||
public void checkDictionaryWord (Client arg1, String arg2, String arg3, String arg4, InvocationService.ResultListener arg5)
|
||||
{
|
||||
InvocationMarshaller.ResultMarshaller listener4 = new InvocationMarshaller.ResultMarshaller();
|
||||
listener4.listener = arg4;
|
||||
InvocationMarshaller.ResultMarshaller listener5 = new InvocationMarshaller.ResultMarshaller();
|
||||
listener5.listener = arg5;
|
||||
sendRequest(arg1, CHECK_DICTIONARY_WORD, new Object[] {
|
||||
arg2, arg3, listener4
|
||||
arg2, arg3, arg4, listener5
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,12 +119,12 @@ public class EZGameMarshaller extends InvocationMarshaller
|
||||
public static final int GET_DICTIONARY_LETTER_SET = 7;
|
||||
|
||||
// from interface EZGameService
|
||||
public void getDictionaryLetterSet (Client arg1, String arg2, int arg3, InvocationService.ResultListener arg4)
|
||||
public void getDictionaryLetterSet (Client arg1, String arg2, String arg3, int arg4, InvocationService.ResultListener arg5)
|
||||
{
|
||||
InvocationMarshaller.ResultMarshaller listener4 = new InvocationMarshaller.ResultMarshaller();
|
||||
listener4.listener = arg4;
|
||||
InvocationMarshaller.ResultMarshaller listener5 = new InvocationMarshaller.ResultMarshaller();
|
||||
listener5.listener = arg5;
|
||||
sendRequest(arg1, GET_DICTIONARY_LETTER_SET, new Object[] {
|
||||
arg2, Integer.valueOf(arg3), listener4
|
||||
arg2, arg3, Integer.valueOf(arg4), listener5
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -91,8 +91,10 @@ public class DictionaryManager
|
||||
* Retrieves a set of letters from a language definition file, and returns a random sampling of
|
||||
* /count/ elements.
|
||||
*/
|
||||
public void getLetterSet (final String locale, final int count,
|
||||
final InvocationService.ResultListener listener)
|
||||
// TODO: honor the dictionary parameter
|
||||
public void getLetterSet (
|
||||
final String locale, final String dictionary, final int count,
|
||||
final InvocationService.ResultListener listener)
|
||||
{
|
||||
CrowdServer.invoker.postUnit(new Invoker.Unit("DictionaryManager.getLetterSet") {
|
||||
public boolean invoke () {
|
||||
@@ -117,8 +119,10 @@ public class DictionaryManager
|
||||
/**
|
||||
* Checks if the specified word exists in the given language
|
||||
*/
|
||||
public void checkWord (final String locale, final String word,
|
||||
final InvocationService.ResultListener listener)
|
||||
// TODO: honor the dictionary parameter
|
||||
public void checkWord (
|
||||
final String locale, final String dictionary, final String word,
|
||||
final InvocationService.ResultListener listener)
|
||||
{
|
||||
CrowdServer.invoker.postUnit(new Invoker.Unit("DictionaryManager.checkWord") {
|
||||
public boolean invoke () {
|
||||
|
||||
@@ -66,7 +66,7 @@ public class EZGameDispatcher extends InvocationDispatcher
|
||||
case EZGameMarshaller.CHECK_DICTIONARY_WORD:
|
||||
((EZGameProvider)provider).checkDictionaryWord(
|
||||
source,
|
||||
(String)args[0], (String)args[1], (InvocationService.ResultListener)args[2]
|
||||
(String)args[0], (String)args[1], (String)args[2], (InvocationService.ResultListener)args[3]
|
||||
);
|
||||
return;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class EZGameDispatcher extends InvocationDispatcher
|
||||
case EZGameMarshaller.GET_DICTIONARY_LETTER_SET:
|
||||
((EZGameProvider)provider).getDictionaryLetterSet(
|
||||
source,
|
||||
(String)args[0], ((Integer)args[1]).intValue(), (InvocationService.ResultListener)args[2]
|
||||
(String)args[0], (String)args[1], ((Integer)args[2]).intValue(), (InvocationService.ResultListener)args[3]
|
||||
);
|
||||
return;
|
||||
|
||||
|
||||
@@ -221,20 +221,22 @@ public class EZGameManager extends GameManager
|
||||
}
|
||||
|
||||
// from EZGameProvider
|
||||
public void getDictionaryLetterSet (ClientObject caller, String locale, int count,
|
||||
InvocationService.ResultListener listener)
|
||||
public void getDictionaryLetterSet (
|
||||
ClientObject caller, String locale, String dictionary, int count,
|
||||
InvocationService.ResultListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
getDictionaryManager().getLetterSet(locale, count, listener);
|
||||
getDictionaryManager().getLetterSet(locale, dictionary, count, listener);
|
||||
}
|
||||
|
||||
// from EZGameProvider
|
||||
public void checkDictionaryWord (ClientObject caller, String locale, String word,
|
||||
InvocationService.ResultListener listener)
|
||||
public void checkDictionaryWord (
|
||||
ClientObject caller, String locale, String dictionary, String word,
|
||||
InvocationService.ResultListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
getDictionaryManager().checkWord(locale, word, listener);
|
||||
}
|
||||
getDictionaryManager().checkWord(locale, dictionary, word, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the dictionary manager if it has been properly initialized. Throws an INTERNAL_ERROR
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface EZGameProvider extends InvocationProvider
|
||||
/**
|
||||
* Handles a {@link EZGameService#checkDictionaryWord} request.
|
||||
*/
|
||||
public void checkDictionaryWord (ClientObject caller, String arg1, String arg2, InvocationService.ResultListener arg3)
|
||||
public void checkDictionaryWord (ClientObject caller, String arg1, String arg2, String arg3, InvocationService.ResultListener arg4)
|
||||
throws InvocationException;
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public interface EZGameProvider extends InvocationProvider
|
||||
/**
|
||||
* Handles a {@link EZGameService#getDictionaryLetterSet} request.
|
||||
*/
|
||||
public void getDictionaryLetterSet (ClientObject caller, String arg1, int arg2, InvocationService.ResultListener arg3)
|
||||
public void getDictionaryLetterSet (ClientObject caller, String arg1, String arg2, int arg3, InvocationService.ResultListener arg4)
|
||||
throws InvocationException;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user