Real Time Multiplayer Game - google-play-games

How to get current participant id in onRoomConnceted method? Previously I used
myId = room.getParticipantId(getGamesClient().getCurrentPlayerId()); in new update it's not available and how to manage this if not available..?

I found the answer here it is
myId = room.getParticipantId(Games.Players.getCurrentPlayerId(getApiClient()));

Related

Update ticket Field in zoho desk

I'm a beginner at using Custom Function on the Zoho desk. I'm trying to update a field in the ticket template.
I have 2 fields in the ticket template [KM, COST]. The cost should equal 2*KM. For example, if KM = 100, then Cost = 200.
I created a workflow that works if the KM is updated and attached the following custom function code, but the field doesn't update.
orgId = "718524341";
response = zoho.desk.getRecordById(orgId,"tickets",TicketID,"zohodesk");
cid = response.get('cf_km');
km_cost = cid * 2;
zoho.desk.update(orgId,"tickets",TicketID,{"cf":{"cf_cost":km_cost}},"zohodesk");
The correct API Name for the tickets module in zoho desk is Tickets.
If you still can't get it to work, then try executing the function independent of the workflow with fixed parameters. Make sure to do info response and post the output here.

ServiceNow: How to create a workflow that runs on incident update?

I need to create a workflow which runs any time an incident is created or updated (or one workflow for each).
When I create a workflow and set the "Table" to Incident, it will run every time an incident is created, but it doesn't run when an incident is updated. I've searched through the wiki and read a slideshow talk on workflow creation, but so far no dice.
Thanks.
You would need to create a business rule on the Incident table that would call your workflow each time there is an update:
var updateOwner = new GlideRecord('wf_workflow');
updateOwner.addQuery('name', '<workflow_name>');
updateOwner.query();
if (updateOwner.next()) {
var wf = new Workflow();
var workflowId = '' + updateOwner.sys_id;
var vars = {};
wf.startFlow(workflowId, current, current.operation, vars);
gs.addInfoMessage('Workflow initiated.');
}

Can Reminder be updated for windows phone

Would appreciate you help for the following.
I have created a reminder but I want to update it before or after the reminder nofiticaton has activated. here the code.
Problem : it wont work even if there is no compilation error for this code.
var Myreminders = ScheduledActionService.GetActions()
.Where(a => a.BeginTime.Month == month);
foreach (Reminder r in Myreminders)
{
string strMyRmd;
strMyRmd = r.Name.ToString();
if ( strMyRmd == "MyName1" )
{
r.Title = "Today Shopping";
}
}
Thanks
I believe (I can't test this from my computer but have confirmed this works with Background Agents) that you need to find your Reminder, remove it from the scheduled action service, update and re add it.
var reminder = (Reminder)ScheduledsActionService.Find("MyReminder");
ScheduledActionService.Remove("MyReminder");
reminder.Title = "Updated Title";
ScheduledActionService.Add(reminder);
According to the remarks section in ScheduledActionService.GetActions Method documentation page:
The Scheduled Action Service does not maintain a reference to the
objects returned by this method, and therefore the properties of the
objects are not updated to reflect the current state after the call to
GetActions. To obtain an object that is updated by the system as its
state changes, use Find(String) instead.
So, just use Find(String) instead.

How to manually load an entity as well as a related entity

I have two entity objects one that holds billing address information(TBLADDRESS) and one that holds my account addresses(TBLMYACCOUNTADDRESS).
At a point in my project i need to load the TBLADDRESS object with the corresponding values from TBLMYACCOUNTADDRESS. Both of which have a relation to LKSTATE.
My problem is i cannot populate this related entity manually. Maybe it's not possible?
Here is my script so far, hopefully it will help you better understand exactly what i am trying to accomplish:
TBLADDRESS tblBilling = new TBLADDRESS();
TBLMYACCOUNTADDRESS myAccountDefaultAddress = new TBLMYACCOUNTADDRESS();
myAccountDefaultAddress = myAccountAddress.FindAll(delegate(TBLMYACCOUNTADDRESS i) { return i.IS_DEFAULT == true; }).ToList().SingleOrDefault();
tblBilling = new TBLADDRESS();
tblBilling.FIRST_NAME = myAccountDefaultAddress.FIRST_NAME;
tblBilling.LAST_NAME = myAccountDefaultAddress.LAST_NAME;
tblBilling.COMPANY = myAccountDefaultAddress.COMPANY;
tblBilling.ADDRESS_1 = myAccountDefaultAddress.ADDRESS_1;
tblBilling.ADDRESS_2 = myAccountDefaultAddress.ADDRESS_2;
tblBilling.CITY = myAccountDefaultAddress.CITY;
tblBilling.LKSTATE.STATE_ID = myAccountDefaultAddress.LKSTATE.STATE_ID;
tblBilling.POSTAL_CODE = myAccountDefaultAddress.POSTAL_CODE;
tblBilling.PHONE = myAccountDefaultAddress.PHONE;
Question is how would i go about populating the tblBilling.LKSTATE.STATE_ID manually. Currently i get an object reference not set to an instance of an object error message, but something tells me there's more to it than that.
Thanks in Advance,
Billy
Figured it out.
All i need was the instance of the object created before assigning to it.
tblBilling.LKSTATE = new LKSTATE();
Initially i wasn't sure just how to create the instance. Pretty straightforward.

How do I retrieve just recurring event masters using Exchange Web services?

I'm using a CalendarItemType view to retrieve calendar items. The only items I care about are those that I've created and I know that they are all weekly recurring items. I'm able to get each individual occurrence and, from any one of them the recurring master item, but I'd like to narrow the scope of my search to just those items that would match my pattern.
I've trying using the Restriction property on the FindItemType to specify a NotEqualTo restriction with a null constant for calenderRecurrenceId. This caused my request to time out. So far I've been unable to load the recurrences with the FindItemType at all and need to use a subsequent GetItemType call when I find an event that is an occurence in a recurring series.
Here's the code that I'm starting with. The code needs to work with both Exchange 2007 and Exchange 2010.
var findItemRequest = new FindItemType();
findItemRequest.ParentFolderIds = new DistinguishedFolderIdType[]
{
new DistinguishedFolderIdType()
};
((DistinguishedFolderIdType)findItemequest.ParentFolderIds[0]).Id = DistinguishedFolderIdNameType.calendar;
findItemRequest.Traversal = ItemQueryTraversalType.Shallow;
var itemShapeDefinition = new ItemResponseShapeType(
{
BaseShape = DefaultShapeNamesType.AllProperties;
}
findItemRequest.Item = calenderView;
findItemRequest.ItemShape = itemShapeDefinition;
var findItemResponse = this.esb.FindItem( findItemRequest );
Also, if you know of any good source of examples (beyond the ones in MSDN), I'd welcome them. I'm picking up someone else's code in an emergency and trying to learn Exchange Web Services on the fly.
Maybe I'm misunderstanding you, in which case I apologize.
You do NOT use the CalendarView - you use the normal IndexedPageItemView if all you want is Master Recurring Calendar items.
You use the CalendarView to expand the recurrences to individual items. However the compromise with CalendarView is NO restrictions are permitted besides Start and End Date. None.
You can search for a RecurrenceMaster by using the recurrence PidLid with an ExtendedPropertyDefinition. This works because, according to their documentation, "this property must not exist on single instance calendar items."
https://msdn.microsoft.com/en-us/library/cc842017.aspx
// https://msdn.microsoft.com/en-us/library/cc842017.aspx
ExtendedPropertyDefinition apptType = new ExtendedPropertyDefinition(
DefaultExtendedPropertySet.Appointment,
0x00008216, //PidLidAppointmentRecur
MapiPropertyType.Binary);
var restriction = new SearchFilter.Exists(apptType);
var iView = new ItemView(10);
var found = folder.FindItems(restriction, iView);
I just confirmed this works, today, when revisiting some old code that works with Office365 EWS in the cloud.
Found only property you need is RecurrenceStart property. Because EWS has limitations it is not possible to use all properties in restriction. This one working as expected.
Reference: Find master recurring appointments
You can create custom searchfilters. If you search from specific startdate OR isRecurring property you have most easy way...(SearchItems returns recurring masters)
List<SearchFilter> searchFilterCollection = new List<SearchFilter>();
SearchFilter.IsGreaterThanOrEqualTo startDatumFilter = new SearchFilter.IsGreaterThanOrEqualTo(AppointmentSchema.Start, new DateTime(2012, 9, 16));
SearchFilter.IsEqualTo masterRecurringFilter = new SearchFilter.IsEqualTo(AppointmentSchema.IsRecurring, true);
searchFilterCollection.Add(startDatumFilter);
searchFilterCollection.Add(masterRecurringFilter);
SearchFilter finalFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.Or, searchFilterCollection);
ItemView itemView = new ItemView(100000);
itemView.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties, AppointmentSchema.AppointmentType);
FindItemsResults<Item> items = _service.FindItems(WellKnownFolderName.Calendar, finalFilter, itemView);

Resources